package com.zyasdk.concurrent;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class ZYAThread {
	private static final ThreadFactory sThreadFactory = new ThreadFactory() {
		private final AtomicInteger mCount = new AtomicInteger(1);

		public Thread newThread(Runnable r) {
			Thread t = new Thread(r, "ZYA_TASK #" + mCount.getAndIncrement());
			t.setPriority(7);
			return t;
		}
	};

	public final static ExecutorService THREAD = Executors
			.newCachedThreadPool(sThreadFactory);
}
